package cn.yunhe.biz;

import org.apache.ibatis.session.SqlSession;
import cn.yunhe.dao.AdminMapper;
import cn.yunhe.pojo.Admin;
import cn.yunhe.util.SqlSessionFactoryUtil;

public class AdminService {
    SqlSession session = SqlSessionFactoryUtil.getSession();
    AdminMapper adminMapper=session.getMapper(AdminMapper.class);
    public int addAdmin(Admin admin){
       int flag = adminMapper.addAdmin(admin);
        session.commit();
        return flag;
    }

    public Admin loginAdmin (Admin admin){
        return adminMapper.loginAdmin(admin);
    }

    public Admin checkAdmin(String adminname){
        return adminMapper.checkAdmin(adminname);
    }


}